<script setup lang="ts">
import MprViewer from '@renderer/components/mprViewer/MprViewer.vue'
import { computed, inject, ref } from 'vue'
import {  NormalScanSeries } from '@renderer/views/multiScanSeriesPage/types'
// import { IPCONFIG } from '@renderer/config'
// let idsMap = {}
// let idsAndToolsRef = ref<any[]>([])
const props = defineProps(['seriesId'])
const {
  scanSeriesArr,
} = inject('multiSeries') as any
const currentSeriesInfoRef = computed<NormalScanSeries>(() => {
  return scanSeriesArr.filter(series => series.id === props.seriesId)[0]
})

// const getIdsAndTools = () => {
//   const seriesId = currentSeriesInfoRef.value.id
//   if (idsMap[seriesId]) {
//     return idsMap[seriesId]
//   }
//   const ids = currentSeriesInfoRef.value.normalImage.map((eachImg, index) => {
//     const toolsGroupId = `${seriesId}-toolsGroupId--${index}`
//     const viewportId1 = `${seriesId}-viewportId-${index}-1`
//     const viewportId2 = `${seriesId}-viewportId-${index}-2`
//     const viewportId3 = `${seriesId}-viewportId-${index}-3`
//     const volumeId = `${seriesId}-volumeId-${index}`
//     const voiSynchronizerId = `${seriesId}-voiSynchronizerId-${index}`
//     const renderingEngineId = `${seriesId}-renderingEngineId-${index}`
//
//     const dicomParams = {
//       StudyInstanceUID: eachImg.studyUID,
//       SeriesInstanceUID: eachImg.seriesUID,
//       wadoRsRoot: IPCONFIG.dicomServer
//     }
//     return {
//       ids: {
//         seriesId,
//         toolsGroupId,
//         renderingEngineId,
//         viewportId1,
//         viewportId2,
//         viewportId3,
//         volumeId,
//         voiSynchronizerId
//       },
//       dicomParams
//     }
//   })
//   idsMap[seriesId] = ids
//   return ids
// }
//
// idsAndToolsRef.value = getIdsAndTools()

</script>

<template>
  <div class="w-full h-full flex">
      <mpr-viewer />
  </div>
</template>

<style scoped>

</style>
